//
//  AnimationView.m
//  jingjing2.0
//
//  Created by apple on 16/5/5.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "AnimationView.h"

@implementation AnimationView

+ (instancetype)sharedAnimationView
{
    static AnimationView *shared_manager = nil;
    static dispatch_once_t pred;
    dispatch_once(&pred, ^{
        shared_manager = [[self alloc] init];
        
    });
    return shared_manager;
}
-(id)init
{
    if (self=[super init]) {
        [self setUpAnimationImage];
        
    }
    return self;
}
-(void)setUpAnimationImage
{
    NSMutableArray *arr=[NSMutableArray array];
    for (int i=0; i<4; i++) {
        NSString *string=[NSString stringWithFormat:@"TZ%d",i+1];
        [arr addObject:[UIImage imageNamed:string]];
    }
    _imageView=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"TZ1"]];
    _imageView.frame=CGRectMake(0, 0, 50, 50);
    [self addSubview:_imageView];
    _imageView.animationImages=arr;
    _imageView.animationDuration=0.7;
    _imageView.animationRepeatCount=0;
    
}


@end
